package com.stefanini.pe.bbva.mbl.in.dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import com.stefanini.pe.bbva.mbl.carga.in.to.CargaLogDetalle;
import com.stefanini.pe.bbva.mbl.carga.in.to.CargaLogDetalleKey;
import com.stefanini.pe.bbva.mbl.in.dao.iface.CargaLogDetalleDAO;
import com.stefanini.pe.bbva.mbl.in.utils.Util;

import org.apache.log4j.Logger;

public class CargaLogDetalleDAOImpl extends SqlMapClientDaoSupport implements CargaLogDetalleDAO {
	private static Logger logger = Logger.getLogger(CargaLogDetalleDAOImpl.class);

    public CargaLogDetalleDAOImpl() {
        super();
    }

    public int deleteByPrimaryKey(CargaLogDetalleKey key) {
    	int rows = 0;
    	
    	logger.info("Inicio");
    	
        rows = getSqlMapClientTemplate().delete("CARGA_LOG_DETALLE.ibatorgenerated_deleteByPrimaryKey", key);
        
        logger.info("Fin");
        
        return rows;
    }

    public void insert(CargaLogDetalle record) {
    	logger.info("Inicio");
    	
        getSqlMapClientTemplate().insert("CARGA_LOG_DETALLE.ibatorgenerated_insert", record);
        
        logger.info("Fin");
    }

    public void insertSelective(CargaLogDetalle record) {
    	logger.info("Inicio");
    	
        getSqlMapClientTemplate().insert("CARGA_LOG_DETALLE.ibatorgenerated_insertSelective", record);
        
        logger.info("Fin");
    }

    public CargaLogDetalle selectByPrimaryKey(CargaLogDetalleKey key) {
    	CargaLogDetalle record = null;
    	
    	logger.info("Inicio");
    	
        record = (CargaLogDetalle) getSqlMapClientTemplate().queryForObject("CARGA_LOG_DETALLE.ibatorgenerated_selectByPrimaryKey", key);
        
        logger.info("Fin");
        
        return record;
    }

    public int updateByPrimaryKeySelective(CargaLogDetalle record) {
    	int rows = 0;
    	
    	logger.info("Inicio");
    	
        rows = getSqlMapClientTemplate().update("CARGA_LOG_DETALLE.ibatorgenerated_updateByPrimaryKeySelective", record);
        
        logger.info("Fin");
        
        return rows;
    }

    public int updateByPrimaryKey(CargaLogDetalle record) {
        int rows = 0;
        
        logger.info("Inicio");
        
        rows = getSqlMapClientTemplate().update("CARGA_LOG_DETALLE.ibatorgenerated_updateByPrimaryKey", record);
        
        logger.info("Fin");
        
        return rows;
    }
    
    public List selectByCriteria(CargaLogDetalleKey record)  {
        List records = null;
        
        logger.info("Inicio");
        
        records = (List) getSqlMapClientTemplate().queryForList(
				"CARGA_LOG_DETALLE.ibatorgenerated_selectByCriteria",record);
        
        logger.info("Fin");
        
		return records;
	}
}